﻿@model CodeSaude.Application.ViewModels.AutenticacaoViewModel
@{
    ViewBag.Title = "Login";
    Layout = "";
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Login no Sistema</title>

    <link rel="stylesheet" href="~/Content/Style.css">
    <style type="text/css">
        body, td, th {
            font-family: "Source Sans Pro", sans-serif;
        }

        body {
            background-image: url(../../images/img_medica.jpg);
            position: relative;
            background-size: auto;
            background-repeat: no-repeat;
            background-color: #0061a2;
        }
    </style>
</head>

<body>




    <div class="wrapper">
        <div class="container">
            <h1><img src="~/images/logo_code_saude.png"></h1>
            <h1>
                <br>
                Acessar o Sistema<br>
            </h1>

            @using (Html.BeginForm("Entrar", "Autenticacao", FormMethod.Post, new { @enctype = "multipart/form-data" }))
            {

                <div class="input-group">
                    <span class="input-group-addon"><i class="fa fa-user"></i></span>
                    @Html.DropDownListFor(m => m.LocalAtendimentoId,
             new SelectList(Model.ListaLocalAtendimento, "LocalAtendimentoId", "NomeLocal"))
                </div>

                <div class="input-group">
                    <span class="input-group-addon"><i class="fa fa-user"></i></span>
                    @Html.TextBoxFor(m => m.Login, null, new { @placeholder = "Login" })
                    @Html.ValidationMessageFor(model => model.Login, null, new { @class = "text-danger" })
                </div>
                <div class="input-group">
                    <span class="input-group-addon"><i class="fa fa-lock"></i></span>
                    @Html.PasswordFor(m => m.Senha, new { @placeholder = "Senha" })
                    @Html.ValidationMessageFor(model => model.Senha, null, new { @class = "text-danger" })
                </div>
                <br>
                <br>
                <br>
                <br>

                <div class="footer" style="cursor:pointer;">
                    Esqueceu sua senha?<br>
                    <a href="#">  Clique aqui e solicite uma nova.</a><br>
                    <br />
                    <button type="submit" class="btn bg-light-blue btn-block" id="login-button">Entrar</button>
                </div>
            }

        </div>
    </div>

    <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>

    <div class="footer">
        CodeHunters IT Solutions<br>
        &reg; 2016 - Todos os direitos reservados<br><br><br><br>
    </div>
</body>
</html>




<script>

    $(document).ready(function () {
        if ('@(TempData["Mensagem"])' != "") {
            swal({
                title: "Mensagem",
                text: '@(TempData["Mensagem"])',
                timer: 3000,
                showConfirmButton: false
            });
        };
    });

    $(function () {
        $(".detalhe").click(function () {
            var email = $('#Email').val();
            if (email == "") {
                swal({
                    title: "Mensagem",
                    text: 'Preencha o campo "e-mail" para resetar a senha!',
                    //timer: 3000,
                    showConfirmButton: true
                });
                //alert('Preencha o campo "e-mail" para resetar a senha!');
            }
            else {
                $.ajax({
                    url: "/Autenticacao/EsqueceuSenha?Email=" + email,
                    type: this.method,
                    data: { search: $('#Email').val() },
                    success: function (result) {
                        window.location = "/Autenticacao/EsqueceuSenha?Email=" + email;
                    }
                });
            };
        });
    });
</script>